# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Angel 'angvp' Velasquez <angvp@archlinux.org>
# Contributor: Gerardo Exequiel Pozzi <vmlinuz386@gmail.com>
# Contributor: Patrick Melo <patrick@patrickmelo.eti.br>

pkgname=geany-plugins
pkgver=1.38
pkgrel=6
pkgdesc='Plugins for Geany'
arch=(loong64 x86_64)
url='https://plugins.geany.org/'
license=(GPL)
depends=(ctpl "geany>=$pkgver" gpgme gtkspell3 libgit2 lua51 python vte3 webkit2gtk)
makedepends=(cppcheck intltool)
source=(libgit2.patch
	update-gpgme-m4.patch
        "$url$pkgname/$pkgname-$pkgver.tar.bz2"{,.sig})
b2sums=('8daf8357caf09eb62844b6c44fa2a819231879b6d7e69bde4039f87230419cf371d1e8b5dede2f23dbb65d5d652b0bce3e51c79164ab8e3d76b445130cd5d387'
        'cd4ae9f197eec44214a3ab6267d94c0602319999f93b2d5a2862b609cbdc5a5c0a834289aa94e65dbe13db81bee4695c3c0b9a2d35ea3efd4e844794cc0cbe24'
        'a2fd9e59218e4b5359b910ccff8d0a6504845081f827d2f1c798ea6401914e8e01222c784a76ab0a126f5fe07c8aa86018cef4c71bb5e2891193f6c8965a3e47'
        'SKIP')
validpgpkeys=('986FA7E80256D3D16F30FB7A01380DF54FD09D02') # Frank Lanitz <frank@geany.org>

prepare() {
  cd $pkgname-$pkgver
  # https://github.com/geany/geany-plugins/issues/1164
  patch -p1 -i ../libgit2.patch
  patch -p1 -i ../update-gpgme-m4.patch

  autoreconf -fi
}

build() {
  cd $pkgname-$pkgver
  export CFLAGS+=' -w' PYTHON=/usr/bin/python
  ./configure --prefix=/usr --libexecdir=/usr/lib
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  make -C $pkgname-$pkgver DESTDIR="$pkgdir" install
}

# getver: plugins.geany.org/downloads.html
